﻿<%@ Control Language="VB" Inherits="System.Web.Mvc.ViewUserControl" %>
<%@ Import Namespace="Equipment.DataAccess" %>
<%  Html.RenderPartial("~/Views/Shared/Controls/TablePager.ascx")%>
<table id="assetTable" class="data-table">
    <thead>
        <tr>
            <th>
                Asset ID
            </th>
            <th>
                Asset Name
            </th>
            <th>
                Asset Type
            </th>
            <th>
                Site
            </th>
            <th>
                Department
            </th>
            <th>
                Status
            </th>
            <th>
                Edit
            </th>
            <th>
                Link Requirements
            </th>
            <th>
                Change Status
            </th>
        </tr>
    </thead>
    <tbody>
        <% For Each item As Asset In ViewData("Assets")%>
        <tr id="asset_<%: item.AssetID%>">
            <td>
                <%: item.AssetID%>
            </td>
            <td>
                <%: item.AssetName%>
            </td>
            <td>
                <%: item.AssetType.Description%>
            </td>
            <td>
                <% If item.SiteDepartment IsNot Nothing Then%>
                    <%: item.SiteDepartment.Parent.Description%>
                <% End If%>&nbsp;
            </td>
            <td>
                <% If item.SiteDepartment IsNot Nothing Then%>
                    <%: item.SiteDepartment.Description%>
                <% End If%>&nbsp;
            </td>
            <td id="assetStatusDesc_<%: item.AssetID%>">
                <%: item.AssetStatus.Description%>
            </td>
            <td>
                <%: Html.ActionLink("Edit", "Edit", New With {.id = item.AssetID})%>
            </td>
            <td>
                <%: Html.ActionLink("Link Requirements", "LinkRequirements", New With {.id = item.AssetID})%>
            </td>
            <td>
                <a href="javascript:statusDialog.show(<%: item.AssetID%>);">Change Status</a>
            </td>
        </tr>
        <% Next%>
    </tbody>
</table>
